Self-Contained Video Analytics and Encoding System comprises of a PTZ camera and stand-alone IP encoder that provides realtime detection and autonomous tracking. The Video Analytics and Encoding System analyzes the captured video signal, generates alarms, and notifies operators of the presence of people, vehicles or objects. The Video Analytics and Encoding System is a self-contained unit that can be easily installed. Self-Contained Video Analytics and Encoding System can also detect events in multiple preset zones.